package com.example.demo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "应用管理", tags = {"应用管理"})
@RestController
@Slf4j
@RequestMapping("/hello")
public class HelloController {

    @ApiOperation(value = "index", notes = "index")
    @GetMapping({"", "/", "/index"})
    public String index() {
        log.info("111111");
        return "hello";
    }

    @ApiOperation(value = "test", notes = "test")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "username", value = "用户名", defaultValue = "李四"),
        @ApiImplicitParam(name = "address", value = "用户地址", defaultValue = "深圳", required = true)
    })
    @GetMapping("/test")
    public String test() {
        log.info("222222");
        return "test123123";
    }

    @GetMapping("/signin")
    public String signin() {
        return "login";
    }
}
